<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
  <%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
  <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title>Thêm câu hỏi</title>
	
	<!-- Load main style css -->
	<%@ include file="../include-file/main-style.jsp" %>

</head>
<body>
	<div class="main-content">
		<!-- Menu bar -->
		<%@ include file="../include-file/header-menu.jsp" %>
		
		<div id="body-content">
		
			<div class="top-right-button">
				
			</div>
			<div class="body-content">
				<div class="list-item">
				   <form:form method="post" action="./quest-insert?surveyId=${map.surveyId}" modelAttribute="questAnsList">
				    
						Nội dung câu hỏi :
						<br>
						<form:textarea row="4" path="question.questContent" class="form-control" type="text" placeholder="Tối đa 100 kí tự"  required='required'/>
					    <br>
					    Giới hạn câu trả lời<form:select path="question.limitAnswer" data-toggle="select" class="form-control select select-default">
			                <option>0</option>
			                <option>1</option>
			                <option>2</option>
			                <option>3</option>
			                <option>4</option>
			            </form:select>
			            <br>
					    Câu trả lời:
					    <div id="list-answer">
						<br>
							<div class="answer-row">
						    <form:input path="answerList[0].answerContent" class="form-control" type="text" placeholder="Đáp án 1" required='required' />
						    <br>
							</div>
							<div class="answer-row">
							<form:input path="answerList[1].answerContent" class="form-control" type="text" placeholder="Đáp án 2" required='required' />
						    <br>
							</div>
						</div>
						<a onClick="addRow()" href="#" class="btn btn-info">Thêm câu trả lời</a>
						
						<a onClick="removeRow()" href="#" class="btn btn-warning"><div class="button-box">Xóa trả lời</div></a>
						<br>
						
						<br>
						<input class="btn btn-primary" type="submit" value="Save" />
				     
				   </form:form>
			   </div>
		   </div>
		   <script src="<c:url value="/resources/js/form-control.js" />"></script>
			<script type="text/javascript">
				var indexRoot = 2;
		   		initIndex();
		   </script>
		   		   
	  </div>
  	</div>
  	
  	<%@ include file="../include-file/footer-script.jsp" %>
  	
</body>
</html>